home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / GXMessages.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  5.9 KB  |  210 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        GXMessages.h
  3.  
  4.      Contains:    This file contains all of the public data structures,
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __GXMESSAGES__
  18. #define __GXMESSAGES__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21. #include <ConditionalMacros.h>
  22. #endif
  23. #ifndef __MACTYPES__
  24. #include <MacTypes.h>
  25. #endif
  26. #ifndef __MIXEDMODE__
  27. #include <MixedMode.h>
  28. #endif
  29.  
  30.  
  31.  
  32. #if PRAGMA_ONCE
  33. #pragma once
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43.  
  44. #if PRAGMA_STRUCT_ALIGN
  45.     #pragma options align=mac68k
  46. #elif PRAGMA_STRUCT_PACKPUSH
  47.     #pragma pack(push, 2)
  48. #elif PRAGMA_STRUCT_PACK
  49.     #pragma pack(2)
  50. #endif
  51.  
  52. #if defined(__MWERKS__) && TARGET_CPU_68K
  53.     #pragma push
  54.     #pragma pointers_in_D0
  55. #endif
  56.  
  57.  
  58. /*
  59.  
  60.     >>>>>> CONSTANTS <<<<<<
  61.  
  62. */
  63. /* Message Manager Trap */
  64.  
  65. enum {
  66.     messageManagerTrap            = 0xABFB
  67. };
  68.  
  69.  
  70. /* Message Manager Error Result Codes */
  71.  
  72. enum {
  73.     messageStopLoopingErr        = -5775,
  74.     cantDeleteRunningHandlerErr    = -5776,
  75.     noMessageTableErr            = -5777,
  76.     dupSignatureErr                = -5778,
  77.     messageNotReceivedErr        = -5799
  78. };
  79.  
  80.  
  81. /*
  82.     DATA TYPES
  83. */
  84. typedef CALLBACK_API_C( OSErr , MessageHandlerOverrideProcPtr )(long arg1, long arg2, long arg3, long arg4, long arg5, long arg6);
  85. typedef STACK_UPP_TYPE(MessageHandlerOverrideProcPtr)             MessageHandlerOverrideUPP;
  86. enum { uppMessageHandlerOverrideProcInfo = 0x0003FFE1 };         /* 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  87. #define NewMessageHandlerOverrideProc(userRoutine)                 (MessageHandlerOverrideUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageHandlerOverrideProcInfo, GetCurrentArchitecture())
  88. #define CallMessageHandlerOverrideProc(userRoutine, arg1, arg2, arg3, arg4, arg5, arg6)  CALL_SIX_PARAMETER_UPP((userRoutine), uppMessageHandlerOverrideProcInfo, (arg1), (arg2), (arg3), (arg4), (arg5), (arg6))
  89. typedef CALLBACK_API_C( void , MessageGlobalsInitProcPtr )(void *messageGlobals);
  90. typedef STACK_UPP_TYPE(MessageGlobalsInitProcPtr)                 MessageGlobalsInitUPP;
  91. enum { uppMessageGlobalsInitProcInfo = 0x000000C1 };             /* no_return_value Func(4_bytes) */
  92. #define NewMessageGlobalsInitProc(userRoutine)                     (MessageGlobalsInitUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, GetCurrentArchitecture())
  93. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals)  CALL_ONE_PARAMETER_UPP((userRoutine), uppMessageGlobalsInitProcInfo, (messageGlobals))
  94. #if OLDROUTINENAMES
  95. typedef MessageHandlerOverrideProcPtr     MessageHandlerOverrideProc;
  96. typedef MessageGlobalsInitProcPtr         MessageGlobalsInitProc;
  97. #endif  /* OLDROUTINENAMES */
  98.  
  99. typedef struct OpaqueMessageHandler*     MessageHandler;
  100. typedef struct OpaqueMessageObject*     MessageObject;
  101. /*
  102.  
  103.     PUBLIC INTERFACES
  104.  
  105.     Message Handler API Routines
  106. */
  107. EXTERN_API_C( long )
  108. CountMessageHandlerInstances    (void)                                                        TWOWORDINLINE(0x7028, 0xABFB);
  109.  
  110. EXTERN_API_C( void *)
  111. GetMessageHandlerClassContext    (void)                                                        TWOWORDINLINE(0x7029, 0xABFB);
  112.  
  113. EXTERN_API_C( void *)
  114. SetMessageHandlerClassContext    (void *                    anyValue)                            TWOWORDINLINE(0x702A, 0xABFB);
  115.  
  116. EXTERN_API_C( void *)
  117. GetMessageHandlerInstanceContext (void)                                                        TWOWORDINLINE(0x702B, 0xABFB);
  118.  
  119. EXTERN_API_C( void *)
  120. SetMessageHandlerInstanceContext (void *                anyValue)                            TWOWORDINLINE(0x702C, 0xABFB);
  121.  
  122. EXTERN_API_C( OSErr )
  123. NewMessageGlobals                (long                     messageGlobalsSize,
  124.                                  MessageGlobalsInitUPP     initProc)                            TWOWORDINLINE(0x702D, 0xABFB);
  125.  
  126. EXTERN_API_C( void )
  127. DisposeMessageGlobals            (void)                                                        TWOWORDINLINE(0x702E, 0xABFB);
  128.  
  129. /*
  130.     Message Sending API Routines
  131. */
  132.  
  133.  
  134. #ifndef BUILDING_GXMESSAGES
  135. EXTERN_API_C( OSErr )
  136. SendObjectMessage                (MessageObject             msgObject,
  137.                                  long                     messageSelector,
  138.                                  ...)                                                        FIVEWORDINLINE(0x205F, 0x221F, 0x702F, 0xABFB, 0x518F);
  139.  
  140. EXTERN_API_C( OSErr )
  141. SendObjectMessageTo                (MessageObject             msgObject,
  142.                                  long                     messageSelector,
  143.                                  MessageHandler         msgHandler,
  144.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7030, 0xABFB, 0x9EFC, 0x000C);
  145.  
  146. EXTERN_API_C( OSErr )
  147. SendObjectMessageFor            (MessageObject             msgObject,
  148.                                  long                     messageSelector,
  149.                                  MessageHandler         msgHandler,
  150.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7037, 0xABFB, 0x9EFC, 0x000C);
  151.  
  152. EXTERN_API_C( OSErr )
  153. StartObjectMessageAt            (MessageObject             msgObject,
  154.                                  long                     messageSelector,
  155.                                  MessageHandler         msgHandler,
  156.                                  ...)                                                        SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7031, 0xABFB, 0x9EFC, 0x000C);
  157.  
  158. #if TARGET_OS_MAC
  159.     #define MacSendMessage SendMessage
  160. #endif
  161. EXTERN_API_C( OSErr )
  162. MacSendMessage                    (long                     messageSelector,
  163.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7032, 0xABFB, 0x598F);
  164.  
  165. EXTERN_API_C( OSErr )
  166. SendMessageTo                    (long                     messageSelector,
  167.                                  MessageHandler         msgHandler,
  168.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7033, 0xABFB, 0x518F);
  169.  
  170. EXTERN_API_C( OSErr )
  171. StartMessageAt                    (long                     messageSelector,
  172.                                  MessageHandler         msgHandler,
  173.                                  ...)                                                        FIVEWORDINLINE(0x221F, 0x241F, 0x7034, 0xABFB, 0x518F);
  174.  
  175. EXTERN_API_C( OSErr )
  176. ForwardMessage                    (long                     messageSelector,
  177.                                  ...)                                                        FOURWORDINLINE(0x221F, 0x7035, 0xABFB, 0x598F);
  178.  
  179. EXTERN_API_C( OSErr )
  180. ForwardThisMessage                (void *                    parameter1,
  181.                                  ...)                                                        TWOWORDINLINE(0x7036, 0xABFB);
  182.  
  183. #endif    /* BUILDING_GXMESSAGES */
  184.  
  185. #if defined(__MWERKS__) && TARGET_CPU_68K
  186.     #pragma pop
  187. #endif
  188.  
  189.  
  190. #if PRAGMA_STRUCT_ALIGN
  191.     #pragma options align=reset
  192. #elif PRAGMA_STRUCT_PACKPUSH
  193.     #pragma pack(pop)
  194. #elif PRAGMA_STRUCT_PACK
  195.     #pragma pack()
  196. #endif
  197.  
  198. #ifdef PRAGMA_IMPORT_OFF
  199. #pragma import off
  200. #elif PRAGMA_IMPORT
  201. #pragma import reset
  202. #endif
  203.  
  204. #ifdef __cplusplus
  205. }
  206. #endif
  207.  
  208. #endif /* __GXMESSAGES__ */
  209.  
  210.